﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;


namespace lcmyjobs.Web.findjobs
{
    public partial class ListNewStudentJobs : BasePage
    {
        lcmyjobs.BLL.user_basic bub = new BLL.user_basic();
        DataSet ds;
        int count = 0;
        int id;
        protected void Page_Load(object sender, EventArgs e)
        {
            id = int.Parse(Application["webid"].ToString());
            if (!IsPostBack)
            {
                this.Title = string.Format("{1}人才网   {1}招聘网   {1}求职网   {1}猎头网  {0}", Application["webname"].ToString(), Application["webregion"].ToString());
                getcout(id);
                //bindData(); //使用url分页，只需在分页事件处理程序中绑定数据即可，无需在Page_Load中绑定，否则会导致数据被绑定两次
            }


        }
        protected void getcout(int atid)
        {
            ds = bub.PageUserSchool1(atid, 1, AspNetPager1.PageSize, out count);
            AspNetPager1.RecordCount = count;
            GridView1.DataSource = ds.Tables[0];
            GridView1.DataBind();

        }
        protected void bind(int atid)
        {
            ds = bub.PageUserSchool1(atid, AspNetPager1.StartRecordIndex, AspNetPager1.PageSize, out count);
            AspNetPager1.RecordCount = count;
            GridView1.DataSource = ds.Tables[0];
            GridView1.DataBind();

        }



        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            if (Application["webid"] != null)
            {
                bind(Convert.ToInt32(Application["webid"]));
            }
            //bind(id);

        }
    }
}